perm filename MIX.DOC[MIX,SYS]2 blob sn#021496 filedate 1973-03-16 generic text, type T, neo UTF8
00100	   MM           MM                II                XX           XX
00200	   MMM         MMM                II                 XX         XX
00300	   MMMM       MMMM                II                  XX       XX
00400	   MM MM     MM MM                II                   XX     XX
00500	   MM  MM   MM  MM                II                    XX   XX
00600	   MM   MM MM   MM                II                     XX XX
00700	   MM    MMM    MM                II                      XXX
00800	   MM     M     MM                II                      XXX
00900	   MM           MM                II                     XX XX
01000	   MM           MM                II                    XX   XX
01100	   MM           MM                II                   XX     XX
01200	   MM           MM                II                  XX       XX
01300	   MM           MM                II                 XX         XX
01400	   MM           MM                II                XX           XX
     

00100	SUMMARY
00200	
00300		MIX  is  a  simulator for the MIX machine described in Knuth,
00400	vol. 1. It has all the  features  described  there,  except  that  it
00500	cannot  do  floating  point  arithmetic, and I/O is limited to a card
00600	reader, card punch, printer, and typewriter.  It has a byte  size  of
00700	64.
00800	
00900		MIX  is  actually  a system of three major parts.  One is the
01000	actual simulator.  The second is the debugging package, which  allows
01100	the  user  to  examine and change loactions in core, set breakpoints,
01200	and perform other useful functions.  The third is  an  assembler  for
01300	the  MIXAL  assebly  language  (a free-format version of the language
01400	described in Knuth.)  MIX  incorporates  all  three  parts  into  one
01500	program.   The  upper-level of this program is the simulator, and the
01600	user can call either of the other parts by pushing  any  of  numerous
01700	"buttons" provided on the machine.  For convenience, MIXAL may be run
01800	separately, without calling the simulator.
01900	
02000		MIX is loaded by typing to the monitor:
02100			R MIX
02200	
02300		MIXAL alone is loaded by typing to the monitor:
02400			R MIXAL
     

00100	DETAILS
00200	
00300	about MIX:
00400	
00500		MIX  is  the  simulator with the debugger and MIXAL assembler
00600	incorporated into it.  Essentially, it is simply  a  machine  with  a
00700	large  number of buttons which you can push.  These buttons allow you
00800	to tell the machine to do various things.  MIX will tell  you  it  is
00900	waiting  for  a button to be pushed by typing "#".  You push a button
01000	by typing the name of the button followed by a carriage-return.  Some
01100	buttons  have  abbreviations.   The  different buttons may be grouped
01200	into several different types.  The buttons of each  type,  and  MIX's
01300	response, are described below.
     

00100	buttons for machine operation:
00200	
00300		GO or G		This  button  causes one card to be read into
00400				locations 0-15.   Then  execution  begins  at
00500				location 0000.
00600	
00700		LOAD or L	This button causes one card to be  read  into
00800				locations  0-15.  Then control returns to the
00900				user.
01000	
01100		START or S	This button causes the execution time  to  be
01200				set  to  zero and rJ to be set to zero.  Then
01300				execution begins at location 0000.
01400	
01500		CONT or C	This button causes execution to be resumed at
01600				the   location   indicated   by  the  program
01700				counter.    (This   works   after    halting,
01800				breakpointing, or stopping for any reason.)
01900	
02000		HALT or H	This   doesn't   do  anything  except  return
02100				control to the user,  where  control  already
02200				was. If you wish to stop the machine while it
02300				is running, type any character at all.   This
02400				will cause MIX to stop as soon as the present
02500				instruction is finished.
02600	
02700		STEP or X	This button causes the next  instruction  (as
02800				indicated  by  the  program  counter)  to  be
02900				executed.  Control then returns to the user.
03000	
03100		ZXT		This button causes the execution time  to  be
03200				set to zero.
03300	
03400		ZPC		This  button causes the program counter to be
03500				set to 0000.
03600	
03700		SETPC		This  button  is  used  to  set  the  program
03800				counter  to whatever you want.  When MIX asks
03900				for it, type the address you want the program
04000				counter to be set to.
04100	
04200		EXIT		This  button  causes  MIX  to  exit, and your
04300				teletype is returned to monitor mode.
     

00100	buttons for finding out about the status of MIX:
00200	
00300	Note:	If you are at a III display, then you will see before  you  a
00400	picture  of  the  MIX  machine.   It shows each of the registers, the
00500	execution  time,  the  program  counter  (which  will  be  the   next
00600	instruction  executed in the normal flow of control), the instruction
00700	which was just executed, and the overflow and comparison  indicators.
00800	If  you  are  not  at a III display, I'm sorry, but you can't see the
00900	picture, you can only read the book.
01000	
01100		DISP or D	This   button   causes   a  type  out  giving
01200				information  about  the  MIX  machine.    The
01300				information  shown is the execution time, the
01400				value  of  MC0000  (which  is  equivalent  to
01500				location  0000  of the simulated MIX memory),
01600				the  value  of  the  program  counter  as  an
01700				absolute  address  (from  which  you subtract
01800				(octally) the value of  MC0000,  to  get  the
01900				octal   equivalent   of   the   real  program
02000				counter), the rA, rX, and rJ  registers,  and
02100				the  instruction  most recently executed (all
02200				of  these   in   byte   format   with   octal
02300				expressions for the bytes).
02400	
02500		MEM or M	This  button  allows  you  to  find  out  the
02600				contents of any location in  MIX's  simulated
02700				core.   When  asked  for  it,  you  type  the
02800				decimal address you would like  to  look  at,
02900				followed  by a carriage-return.  The contents
03000				of that location, in octal byte format,  will
03100				be typed out.  You may keep doing this for as
03200				many locations you wish to examine.  When you
03300				wish  to  leave  MEM  mode,  type  X (must be
03400				capital X) followed by a carriage-return.
03500	
03600		UPDATE		This button causes the display of MIX  to  be
03700				updated.  (This  is  only  useful  at  a  III
03800				display, and then it isn't really, since  the
03900				display  is  updated  just  before  each # is
04000				typed.)
04100	
04200		SETUP		This button allows you to vary the number  of
04300				executed  instructions between updates of the
04400				screen.  Normally,  the  display  is  updated
04500				after    every   instruction   is   executed.
04600				However,  this   slows   the   program   down
04700				considerably.  So  you  may  wish to have the
04800				display  updated  less  often.  After   being
04900				prompted  by  MIX, you should type the number
05000				of  instructions  (decimal)  that  you   wish
05100				executed   between  updates  (10  to  30  are
05200				reasonable numbers if you want to see  things
05300				happening, but still not slow the machine too
05400				much.) If you type the number 0,  the  screen
05500				will  not  be  updated  until  MIX returns to
05600				button mode, whenever that may be.
     

00100	buttons for doing things about i/o:
00200	
00300	Note:	All  I/O  for  MIX  (except  for the typewriter) is done with
00400	files rather than with devices.  Thus,  the  card  reader,  the  card
00500	punch,  and  the  printer are really files.  So, to turn on a device,
00600	you  give  MIX  a  file  name.   The   syntax   for   filenames   is:
00700	<name>.<ext>[prj,prg],  where <ext> and [prj,prg] are optional.  Each
00800	device has two buttons, one to turn it on (get a  filename)  and  the
00900	other  to  turn it off (close the file).  Typewriter I/O is naturally
01000	done on the teletype.
01100	
01200		READ		This  button turns on the card reader.  After
01300				prompting from MIX, you should type the  file
01400				to be used for input.
01500	
01600		READX		This  button  closes  the  file  for the card
01700				reader, so  it  really  turns  off  the  card
01800				reader.
01900	
02000		PUNCH		This  button  turns  on the card punch. After
02100				prompting from MIX, you should type the  file
02200				to be used for output.
02300	
02400		PNCHX		This  button  closes  the  file  for the card
02500				punch, so it really turns off the card punch.
02600	
02700		PRINT		This button  turns  on  the  printer.   After
02800				prompting  from  MIX you should type the file
02900				to be used for output.
03000	
03100		PRNTX		This button closes the file for the  printer,
03200				so it really turns off the printer.
     

00100	buttons used for tracing:
00200	
00300	Note:	You  may  wish  to  have a trace showing the status of MIX at
00400	each stage of a given run.  MIX has such a tracing feature.  It  will
00500	create  a  file  which shows the status of MIX after each instruction
00600	has been executed.  However, you must specify an upper limit  to  the
00700	number  of times each particular instruction will be shown.  You also
00800	get  a  dump  of  all  non-zero  locations  in  core.   This  happens
00900	automatically  after each HLT instruction is executed. Also note that
01000	since the byte size is 64, rather than 100, decimal  printouts  don't
01100	show  byte  break-downs very well.  All printouts are in decimal with
01200	the following exceptions:   the  INSTRUCTION  is  shown  in  standard
01300	instruction  format  (+AA,I,F,C),  without  spaces  between  the byte
01400	groupings; the CONTENTS are  shown  broken  into  byte  groupings  as
01500	indicated  by the F-field of the instruction, with spaces surrounding
01600	the bytes which are designated by the F-field (between the spaces  is
01700	one  decimal  number).   The  O  and  C columns show the Overflow and
01800	Comparison indicators respectively.
01900	
02000	
02100		TRACE		This button is used  to  open  up  the  trace
02200				file.  After  prompting  from MIX, you should
02300				type the name of the file you want the  trace
02400				written  onto.  After  further prompting, you
02500				should type the maximum number  (decimal)  of
02600				times  each  location may be traced.  Tracing
02700				will begin immediately after this  button  is
02800				pushed.
02900	
03000		TK		This  button  is  used  to change the maximum
03100				number of traces per location.  Note  that  0
03200				effectively turns off the trace.
03300	
03400		DUMP		This  button  causes an immediate dump of all
03500				non-zero locations in MIX's  simulated  core.
03600				It is the same as you get automatically after
03700				a HLT is executed.
03800	
03900		TRACX		This button causes tracing to  stop  and  the
04000				file to be closed.
     

00100	buttons for MIXAL:
00200	
00300	Note:	See  the  section  about  MIXAL  for  more  details about the
00400	language.
00500	
00600		MIXAL		This button causes a MIXAL source file to  be
00700				assembled.   You will be asked for a name and
00800				you should give it one.  If  it  types  *****
00900				and  you  have  seen  no  error messages, you
01000				should be O.K.  Your assembled  program  will
01100				NOT  be  loaded.  A  <name>.LST  file  and  a
01200				<name>.MLD file will be  created.   The  .LST
01300				file  is  a  listing and the .MLD file is for
01400				loading into MIX.
01500	
01600		MIXLOAD or MLD	This button is for loading a .MLD  file  into
01700				MIX's  simulated  core.   You  must give it a
01800				filename,  but  since  the   extension   will
01900				probably  be MLD, you may omit it and it will
02000				be assumed to be there. The  program  counter
02100				is  set  to  the  value indicated in your END
02200				statement and the symbol table is loaded  for
02300				use  by  the  debugger.  You may execute your
02400				program at this point  by  pushing  the  CONT
02500				button.
02600	
02700		PCMLD		This  button causes the program counter to be
02800				reset to the starting  address  of  the  most
02900				recently loaded MLD file.
     

00100	buttons for the debugger:
00200	
00300	Note:	All  buttons  for  the  debugger have <alt-mode> as the first
00400	character. This is indicted in the descripions by $.   All  addresses
00500	may  be  absolute  or  symbolic  (referring  to  symbols  in the most
00600	recently loaded MLD file). All instructions may be symbolic using the
00700	standard  MIXAL  op-codes.  Pseudo-ops are, of course, not permitted.
00800	These buttons have a strange syntax,  in  that  the  button  name  is
00900	followed  by  some  string.   Don't let that bother you.  Also, it is
01000	important to know that anytime the symbols RA, R1, R2,  R3,  R4,  R5,
01100	R6, RX, RJ are encountered they will be considered to be referring to
01200	the appropriate registers of MIX rather than to any  symbol  in  your
01300	program.   Thus,  you probably shouldn't use these as symbols in your
01400	program since you will not be able to  refer  to  them  symbolically.
01500	Another  important  symbol  to  know  about is *.  When not used as a
01600	multiply operator, it refers to a special address.  This  address  is
01700	the  most  recently  referred  to  address in a $E, $D, $B, $U, or $=
01800	command.  Any command which refers to a register will not affect  the
01900	value  of  *.   *  may  be  used wherever a symbol is permitted.  All
02000	expressions are in the standard MIXAL format.
02100	
02200		$B address
02300			This sets a breakpoint at this address.
02400	
02500		$U address
02600			This removes the breakpoint at this address if  there
02700			is one.
02800	
02900		$U
03000			This removes all breakpoints.
03100	
03200		$E address
03300			This displays,  in  symbolic  instruction  mode,  the
03400			contents of the core location with this address.
03500	
03600		$EN address
03700			This  displays,  in  numeric  instruction  mode,  the
03800			contents of the core location with this address.
03900	
04000		$ES address
04100			This displays, in symbolic decimal mode, the contents
04200			of the core location with this address.
04300	
04400		$ED address
04500			This displays, in decimal mode, the contents  of  the
04600			core location with this address.
04700	
04800		$EB address
04900			This displays, in byte mode, the contents of the core
05000			location with this address.
05100	
05200		$EA address
05300			This displays, in ALF mode, the contents of the  core
05400			location with this address.
05500	
05600		$<line-feed>
05700			This displays the contents of the core location  with
05800			the  address  *+1  in  the same mode as most recently
05900			used to display some other address.
06000	
06100		$DW address←W-value
06200			This  causes  this  W-value  to be deposited into the
06300			core location with this address.
06400	
06500		$DI address←instruction
06600			This causes this instruction to be deposited into the
06700			core location with this address.
06800	
06900		$=S address
07000			This  causes  the symbolic equivalent of this address
07100			(the address itself, not the  contents  of  any  core
07200			location) to be displayed.
07300	
07400		$=D address
07500			This causes the decimal equaivalent of  this  address
07600			(the  address  itself,  not  the contents of any core
07700			location) to be displayed.
07800	
07900		$J address
08000			This causes execution of MIX instructions to begin at
08100			the core location with this address.
08200	
08300		$X instruction
08400			This causes this instruction (the instruction itself,
08500			not the instruction at any particular core  location)
08600			to be executed.
     

00100	DETAILS
00200	
00300	about MIXAL:
00400	
00500	The version of MIXAL used here is quite similar to that described  in
00600	Knuth,  but is a free-format version. That is, extra spaces may occur
00700	in weird places without making  any  significant  difference.   Also,
00800	there  may  be  only one statement to a line.   The major differences
00900	with a standard version to worry about are:
01000		(1) remarks in non-comment lines must be preceded by a ";".
01100		(2) in an ALF statement, there must be exactly one  character
01200		     (which  may  be  a  <tab>)  between  ALF  and  the  five
01300		     characters which are the constant.
01400		(3)  if  the LOC field is supposed to be empty, there must be
01500		     either a <space> or a <tab> as the  first  character  in
01600		     the line.
01700		(4) SOS line numbers  and  page  marks  are  ignored  by  the
01800		     assembler, except when printing error messages.
01900	
02000		During the assembly process, two files are created:
02100		(1) filename.LST	this is a listing of your program.
02200		(2) filename.MLD	this  is  the  file  to load into the
02300					simulator.
02400	
02500		There are a couple  of  things  to  say  about  the  program.
02600	Mostly  about  the  file called "filename.LST".  This file contains a
02700	listing of your  program  along  with  the  assembled  program.   The
02800	assembled  program  appears  on the left side of the page.  The first
02900	thing is the value of "*" before the line is assembled.  This is  the
03000	address  which  is  given  to symbols in the LOC field, and the place
03100	where assembled code is put.  If this address is invalid (i.e.:  less
03200	than  0  or greater than 3999), then four asterisks are put where the
03300	address would normally appear. Next, there may  appear  a  couple  of
03400	little  arrows.   A  "↓"  means  that  the  address  portion  of  the
03500	instruction contains a future-reference.  A "←" means that  a  symbol
03600	is  defined  on  this  line, and that symbol was used previously as a
03700	future-reference.  Then comes the assembled word to  be  loaded  into
03800	the  MIX machine.  This word is split into byte-groupings in a manner
03900	which is appropriate  for  the  circumstances.   If  there  were  any
04000	errors,  they are indicated on the next line by numbered codes in the
04100	order in which they occurred.  The numbered codes are as follows:
04200		 1 - error on output
04300		 2 - illegal operator
04400		 3 - syntax error
04500		 4 - error on input
04600		 5 - no "=" after literal: ignore all till I find it
04700		 6 - illegal character: ignored
04800		 7 - error in expression: value set to zero
04900		10 - bad F-part: assumed to be (0:5)
05000		11 - error in W-value: assumed to be 0
05100		12 - invalid LOC field
05200		13 - some error in or after address-field
05300		14 - should be end-of-line: will try to find it
05400		15 - error in or after index-field
05500		16 - error in or after field-field
05600	
05700		There  are  a  few  differences between this version and that
05800	which lives in Stanford's 360.  The most notable  is  that  undefined
05900	symbols  at the end of the program are put in after the END statement
06000	(in fact, while listing the symbol table), not immediately preceeding
06100	the  END statement.  The two have a different effect only if there is
06200	a label on the END  statement,  in  which  case  the  PDP-10  version
06300	doesn't  define  it  again,  whereas  the  360  version  will  have a
06400	duplicated label error on the END statement.
06500	
06600		Other differences  include  stuff  about  the  symbol  names.
06700	Symbol  names  may  be as long as you want, but only the first twelve
06800	characters will be used.  There are no special characters allowed  as
06900	characters  in symbols (f'rinstance, you can't use % or $).  Literals
07000	are given the symbol name "=LIT= ", for the first six chars, and  the
07100	next  six chars are the evaluated MIX word which is equivalent to the
07200	symbol.  Thus, if you use two literals which  both  evaluate  to  the
07300	same MIX word, they will be the same symbol.  Local symbols are given
07400	the symbol name "iLOCAL" for the first six chars, and  the  next  six
07500	chars  are  actually  the  number  of the occurrence of "iH" which is
07600	referred to.
     

00100	A SAMPLE RUN:
00200	
00300		It may be helpful to show what commands might be used to give
00400	a  simple,  but  complete,  run  of a program written in MIXAL. Let's
00500	assume that you have a MIXAL program on a file called PEACE.  (I will
00600	indicate  what you type in small letters, and what MIXAL or MIX types
00700	in capital letters.) Here we go:
00800	
00900	.r mixal
01000	
01100	MIXAL
01200	
01300	FILENAME FOR INPUT:  peace
01400	*****
01500	EXIT
01600	↑C
01700	
01800	[let's  suppose that at this point you discover that you made a minor
01900	error in your program:  at location START+7 you had  ENT1  X+3,4  and
02000	you  meant  to  have ENT2 X+3,4.  however, rather than reassemble the
02100	whole program, you decide to change it after it is loaded.]
02200	
02300	.r mix
02400	
02500	
02600	#trace
02700	
02800	FILE FOR TRACE OUTPUT: peace.tra
02900	MAXIMUM PRINT TIME = 2
03000	
03100	
03200	#print
03300	
03400	FILE FOR PRINTER OUTPUT: peace.prn
03500	
03600	
03700	#mld
03800	
03900	MIX-LOAD FILE: peace.mld
04000	
04100	
04200	#$e start+7
04300	 ENT1	X+3,4
04400	
04500	#di *←ent2 x+3,4
04600	
04700	#$e *
04800	 ENT2	X+3,4
04900	
05000	#c
05100	
05200	
05300	#HALT#
05400	
05500	#exit
05600	
05700	
05800	EXIT
05900	↑C
06000	
06100	.
     

00100	to anyone interested in debugging MIX or MIXAL:
00200	
00300	the files MIX and MIXAL are command files which can be used  to  load
00400	MIX  and  MIXAL.  the files MIX.LIS and MIXAL.LIS are files which can
00500	be used to list all the files used to assemble MIX and MIXAL.  Thus,
00600		LOAD @MIX	loads MIX
00700		LOAD @MIXAL	loads MIXAL
00800		LIST @MIX.LIS	lists all the files which assemble into MIX
00900		LIST @MIXAL.LIS	lists all the files which assemble into MIXAL
01000	
01100	all the files of interest to MIX users are found on [MIX,SYS].